import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/pages/Login'
import Home from '@/pages/Home'
import EditPost from '@/pages/EditPost'
import PostList from '@/pages/PostList'
Vue.use(Router)

export default new Router({
  routes: [
  
    {
      path: '/',
      name: 'HomePage',
      component: Home,
      meta:"首页",
      // 嵌套子路由
      children:[
        {
          path: 'postlist',
          name: 'PostListPage',
          component: PostList,
          meta:'编辑文章'
        },
        {
          path: 'editpost',
          name: 'EditPostPage',
          component: EditPost,
          meta:'文章列表'
        },
      ]
    },
    {
      path: '/login',
      name: 'LoginPage',
      component: Login
    },
    
  ]
})
